package cn.tang.tframe.mq;

import cn.tang.tframe.common.utils.id.UidGenerator;

import java.io.Serializable;
import java.util.HashMap;

/**
 * Created by tanghc on 17/2/4.
 */
public class QtMessager<T extends Serializable> implements IQtMessager<T>{

	private T object;
	private String msgId = UidGenerator.get().toString();
	private HashMap<String,Object> attach = new HashMap<>();

	public QtMessager(T object) {
		this.object = object;
	}

	@Override
	public T getBody() {
		return this.object;
	}

	@Override
	public String getMsgId() {
		return this.msgId;
	}

	@Override
	public void attach(String key, Object value) {
		this.attach.put(key,value);
	}

	@Override
	public HashMap<String, Object> getAttach() {
		return this.attach;
	}
}
